/*************************************************
* Title：TinyToolKit
* Author：Opportunity 
* Describe：
* CreateTime：2020-12-25 12:30:57
* Version：1.0
* Modify Recorder：
*************************************************/

using TinyToolKit.Demo;
using TinyToolKit.UI;
using UnityEngine;
using UnityEngine.UI;

public class ABMainForm : DefaultUIFormBase
{
   public Button loadAssetBtn;
   public Button loadAssetAsyncBtn; 
   public Button unloadAssetBtn;
   public Button reloadSceneBtn;

   protected override void OnInit()
   {
      base.OnInit();

      AssetBundleTest assetBundleTest = GameObject.Find("ScriptHolder").GetComponent<AssetBundleTest>();
      loadAssetBtn.onClick.AddListener(assetBundleTest.OnLoadAssetBtnClick);
      loadAssetAsyncBtn.onClick.AddListener(assetBundleTest.OnLoadAssetAsyncBtnClick); 
      unloadAssetBtn.onClick.AddListener(assetBundleTest.OnUnloadAssetClick);
      reloadSceneBtn.onClick.AddListener(assetBundleTest.OnReloadSceneClick);
   }
   
   public void SetLogoImg(Sprite sprite)
   {
      Image img = transform.Find("Logo").GetComponent<Image>();
      img.sprite = sprite;
   }
}
